/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Classes;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Jaroslav
 */
@Entity
@Table(name = "project")
@NamedQueries({@NamedQuery(name = "Project.findByProjectId", query = "SELECT p FROM Project p WHERE p.projectId = :projectId"), 
@NamedQuery(name = "Project.findByProjectName", query = "SELECT p FROM Project p WHERE p.projectName = :projectName"), 
@NamedQuery(name = "Project.findByDescription", query = "SELECT p FROM Project p WHERE p.description = :description"), 
@NamedQuery(name = "Project.findByProjectUrl", query = "SELECT p FROM Project p WHERE p.projectUrl = :projectUrl")})
public class Project implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "project_id", nullable = false)
    private Integer projectId;
    @Column(name = "project_name", nullable = false)
    private String projectName;
    @Column(name = "description", nullable = false)
    private String description;
    @Column(name = "project_url", nullable = false)
    private String projectUrl;

    public Project() {
    }

    public Project(Integer projectId) {
        this.projectId = projectId;
    }

    public Project(Integer projectId, String projectName, String description, String projectUrl) {
        this.projectId = projectId;
        this.projectName = projectName;
        this.description = description;
        this.projectUrl = projectUrl;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getProjectUrl() {
        return projectUrl;
    }

    public void setProjectUrl(String projectUrl) {
        this.projectUrl = projectUrl;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (projectId != null ? projectId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Project)) {
            return false;
        }
        Project other = (Project) object;
        if ((this.projectId == null && other.projectId != null) || (this.projectId != null && !this.projectId.equals(other.projectId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Classes.Project[projectId=" + projectId + "]";
    }

}
